#!bin/bash
echo 'delete old file'
rm -rf /tmp/kafka-logs
nohup /home/kafka/bin/zookeeper-server-start.sh /home/kafka/config/zookeeper.properties 1>/dev/null 2>&1 &
nohup /home/kafka/bin/kafka-server-start.sh /home/kafka/config/server.properties 1>/dev/null 2>&1 &

echo 'start server...'
sleep 3
echo 'createing topic testtopic'
/home/kafka/bin/kafka-topics.sh --create --zookeeper adkafka.com:2181 --replication-factor 1 --partitions 1 --topic testtopic
echo 'start consumer topic testtopic...'
/home/kafka/bin/kafka-console-consumer.sh --bootstrap-server adkafka.com:9092 --topic testtopic

